package com.woniu.user.mapper;

import com.woniu.common.entity.User;
import com.woniu.user.entity.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author author
 * @create 2021/5/20
 */
@Mapper
public interface MessageMapper {

    @Select("select id,title,content,release_time from message")
    List<Message> selectAllMessage();

    @Insert("insert into message values(default,#{title},#{content},#{release_time})")
    Boolean insertMessage(Message message);

    @Select("select * from user where name=#{name}")
    User selectUser(String name);

}
